<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class LuckyController extends Controller
{
    /**
     * @Route("/lucky/number")
     */
    public function indexAction()
    {

        $number = mt_rand(0,100);

        $html = "
            <!DOCTYPE html>
            <html>
            <head>
                <title>$number</title>
            </head>
            <body>

            </body>
            </html>
        ";

        return new response(  $html);
    }

    /**
     * @Route("/lucky/number2")
     */
    public function index2Action()
    {

        $number = mt_rand(0, 100);

        return $this->render('lucky/number.html.twig', array(
            'number' => $number,
        ));
    }
}
